CTU_UDINT block

Short summary

Name

CTU_UDINT

→POU type

→function block

Category

IEC-block, Counter

Conform to →IEC-standard

(tick) no restrictions

Graphical interface

Available since

version 1.19.0 (for Neuron Power Engineer)

Functionality

The block is an up-counter (for UDINT values).

If there is a positive →edge at input CU, the counter is activated and increments the counter value by 1. If input R is →turned on, the counter value is reset to value 0. Enter a limiting value at input PV. If this limiting value is reached or exceeded, output Q is set to value TRUE (or an equivalent). The incrementing is stopped, if the upper limit of UDINT (= value 4,294,967,295) is reached. Output CV returns the current counter value of the block.

In-/outputs

 

Identifier

→Data type

Description

Inputs:

CU

BOOL

increment in case of positive edge 

R

BOOL

flag for reset

PV

UDINT

limiting value

Outputs:

Q

BOOL

flag showing whether limiting value is reached or not

CV

UDINT

current counter value

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Example for usage within ST-editor

PROGRAM Test
    VAR
        myCTU          : CTU_UDINT;
        StartCounter   : BOOL;
        RestartCounter : BOOL;
        out            : BOOL;
        counter        : UDINT;
    END_VAR
 
    myCTU(CU := StartCounter, R := RestartCounter, PV := 10, Q => out, CV => counter);
    (* Instance of block 'CTU_UDINT' is called: The counter is activated, when 'StartCounter' is 'TRUE'. The value for counting is reset to '0', when 'RestartCounter' is 'TRUE'. *)
    (* The limiting value for counting is '10'. *)
    (* Appropriate variables access the outputs. *)
END_PROGRAM

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.